//
//  JHRulerStyle.m
//  iOS尺子控件
//
//  Created by JH on 2017/4/18.
//  Copyright © 2017年 JH. All rights reserved.
//

#import "JHRulerStyle.h"
#define RGBColorFromHex(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
@implementation JHRulerStyle


- (instancetype)init{
    self = [super init];
    if (self) {
        self.backgroundColor = RGBColorFromHex(0xf9f9f9);
        self.lineColor = RGBColorFromHex(0xc7c7c7);
        self.font = [UIFont systemFontOfSize:18];
        self.margin = 15.0;
        self.spacing = 10;
        self.longLineLength = 24;
        self.shortLineLength = 12;
        self.minValue = 0;
        self.maxValue = 100;
        self.accuracy = 1;
        self.stopOnTheLine = YES;
        self.markViewColor = RGBColorFromHex(0xea5151);
        self.markViewSize = CGSizeMake(16, 8);
    }
    return self;
}

- (NSInteger)defaultVaule{
    if (_defaultVaule == 0) {
        _defaultVaule = self.minValue;
    }
    return _defaultVaule;
}


@end
